From: Ray Strode Date: Thu, 18 Jul 2013 12:58:58 +0000 (-0400) Subject: screenShield: defer deactivation until all messages are shown X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3916 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ded99b9a09ccba059073ba6ec82ed3e58c6d810f;p=gnome-shell.git screenShield: defer deactivation until all messages are shown Right now when a user types their password to unlock their session we end up getting an unlock signal from GDM right away. We then proceed to deactivate the screensaver before the user has a chance to read his messages. This commit makes sure we clear out the message queue before processing the deactivation request. https://bugzilla.gnome.org/show_bug.cgi?id=704347 --- diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index d7bf4616f..8271aa0a1 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -1121,6 +1121,12 @@ const ScreenShield = new Lang.Class({ }, deactivate: function(animate) { + this._dialog.finish(Lang.bind(this, function() { + this._finishDeactivate(animate); + })); + }, + + _finishDeactivate: function(animate) { this._hideLockScreen(animate, 0); if (this._hasLockScreen) diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js index e2646ea5c..75d11381d 100644 --- a/js/ui/unlockDialog.js +++ b/js/ui/unlockDialog.js @@ -281,4 +281,18 @@ const UnlockDialog = new Lang.Class({ addCharacter: function(unichar) { this._promptEntry.clutter_text.insert_unichar(unichar); }, + + finish: function(onComplete) { + if (!this._userVerifier.hasPendingMessages) { + onComplete(); + return; + } + + let signalId = this._userVerifier.connect('no-more-messages', + Lang.bind(this, function() { + this._userVerifier.disconnect(signalId); + onComplete(); + })); + + } });